import { reactive } from '@vue/reactivity'
import { computed, toRefs, watch } from 'vue';
function HookCount() {
    const state = reactive({
        count: 1,
        addCount() {
            state.count++
        },
        double: computed(() => {
            return state.count * 2
        })
    })
    //监听state中某一个值
    watch(()=>state.count, () => {
        console.log(state.count);
        document.title = state.count
    })
    const refState = toRefs(state);
    return refState
}
export default HookCount;